<?php

/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/11/27/0027
 * Time: 14:15
 */

namespace app\sports_admin\controller;


use think\Config;

class Index extends Base
{
    /**
     * 后台首页
    */
    public function index()
    {
        return view('index');
    }
    /**
     * 后台欢迎页面
    */
    public function welcome()
    {
        $info['url'] = $_SERVER['HTTP_HOST'];
        $info['run_mode'] = PHP_SAPI;
        $info['server_software'] = $_SERVER["SERVER_SOFTWARE"];
        $info['php_version'] = PHP_VERSION;
        $info['os'] = PHP_OS;
        $info['think_version'] = THINK_VERSION;
        $info['upload_max_filesize'] = get_cfg_var ("upload_max_filesize") ? get_cfg_var ("upload_max_filesize"):"不允许上传附件";
        $info['max_execution_time'] = get_cfg_var("max_execution_time")."秒 ";
        $database = Config::get('database');
        $con =  mysqli_connect($database['hostname'],$database['username'],$database['password']);
        $info['mysqli_get_server_info'] = mysqli_get_server_info($con);
        $len = strripos(__DIR__,":");
        $dir = substr(__DIR__,0,$len+1);
        $info['size'] = round(disk_free_space($dir)/(1024*1024*1024),2)."G";
        return view('welcome',compact('info'));
    }

}